package com.dwd.org.service.impl;

import com.dwd.basic.service.impl.BaseServiceImpl;
import com.dwd.org.mapper.EmployeeMapper;
import com.dwd.org.pojo.Employee;
import com.dwd.org.service.IEmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description: TODO
 * @Author 汶狄
 * @Date 2021/1/11 11:02
 * @Version 1.0
 */
@Service
public class EmployeeServiceImpl extends BaseServiceImpl<Employee> implements IEmployeeService {
    @Autowired
    EmployeeMapper employeeMapper;

    /**
     * 查询上级经理
     *
     * @return
     */
    @Override
    public List<Employee> queryManager() {
        return employeeMapper.queryqueryManager();
    }

    /**
     * 根据用户名查询用户
     *
     * @param username
     * @return
     */
    @Override
    public Employee queryByName(String username) {
        return employeeMapper.queryByName(username);
    }

    /**
     * 根据当前登陆用户，查询所多对应的权限
     *
     * @param id
     * @return
     */
    @Override
    public List<String> queryPermis(Long id) {
        return employeeMapper.queryPermis(id);
    }

    @Override
    public String queryRole(Long id) {
        return employeeMapper.queryRole(id);
    }

    /**
     * 查询所有权限
     * @return
     */
    @Override
    public List<String> queryAllPermis() {
        return employeeMapper.queryAllPermis();
    }

    /**
     * 根据登陆用户的id查询员工id
     * @param id
     * @return
     */
    @Override
    public Long queryempIdByLoginInfoId(Long id) {
        return employeeMapper.queryempIdByLoginInfoId(id);
    }
}
